package cn.yl.consumerOpenfeign.controller;

import cn.yl.consumerOpenfeign.service.ProviderService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/consumer")
public class ConsumerController {

    private final ProviderService providerService;

    public ConsumerController(ProviderService providerService) {
        this.providerService = providerService;
    }

    @GetMapping("/port")
    public String getPort() {
        return providerService.getPort();
    }

    @GetMapping("/feign/timeout")
    public String providerFeignTimeOut() {
        System.out.println("providerFeignTimeOut--------------->");
        return providerService.providerFeignTimeOut();
    }

}
